import Vue from 'vue'
import App from './App'
import Store from './store'
import uView from '@/uni_modules/uview-ui'
import UniPlugin from './static/js/uniPlugin'
import { envConfig } from './static/js/env/env'
import { router, RouterMount } from './static/js/utils/router'
import vconsole from "vconsole";

// #ifdef H5
if (process.env.NODE_ENV == "development") {
  Vue.prototype.vconsole = new vconsole();
}
// #endif

Vue.use(uView)
Vue.use(router)
Vue.use(UniPlugin)
Vue.prototype.$store = Store
Vue.prototype.$envConfig = envConfig

import updateVersion from '@/components/updateVersion'
import navigation from '@/components/navigation'
import backdrop from '@/components/backdrop'
import reservation from '@/components/reservation'
import serviceList from '@/components/serviceList'
import craftsmanList from '@/components/craftsmanList'
import sliderRange from '@/components/sliderRange'
import detailNavigation from '@/components/detailNavigation'
import sex from '@/components/sex'
import chooseTime from '@/components/chooseTime'

Vue.component('updateVersion', updateVersion)
Vue.component('navigation', navigation)
Vue.component('backdrop', backdrop)
Vue.component('reservation', reservation)
Vue.component('serviceList', serviceList)
Vue.component('craftsmanList', craftsmanList)
Vue.component('sliderRange', sliderRange)
Vue.component('detailNavigation', detailNavigation)
Vue.component('sex', sex)
Vue.component('chooseTime', chooseTime)

Vue.config.productionTip = false

App.mpType = 'app'
const app = new Vue({
  ...App
})

// #ifdef H5
RouterMount(app, router, '#app')
// #endif

// #ifndef H5
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif
